package com.gzs.learn.admin.task;

import com.gzs.learn.common.util.HttpUtil;
import org.springframework.stereotype.Component;

import java.util.concurrent.ThreadLocalRandom;

@Component("sysLogBuildTask")
public class SysLogBuildTask {

    public static final String BASE = "http://localhost:7080";

    public void doGetWebApiRequest() {
        int random = ThreadLocalRandom.current().nextInt(20, 50);
        for (int i = 0; i < random; i++) {
            HttpUtil.doGet(BASE + "/api/web/test", String.class);
        }
    }

    public void doGetLogApi() {
        int random = ThreadLocalRandom.current().nextInt(5, 20);
        for (int i = 0; i < random; i++) {
            HttpUtil.doGet(BASE + "/api/log/test", String.class);
        }
    }

}
